<?php
/**
 * TemplateValidate.php
 * @author zohnの梦
 * @email  1171672036@qq.com
 * @date   2021/1/8
 */

namespace app\api\validate;


use think\Validate;

class TemplateValidate extends Validate
{
    protected $rule = [
        'id'    => ['require', 'number'],
        'ids'   => ['require', 'array'],
        'title' => ['require']
    ];

    protected $message = [
        'id.require'    => '请选择数据',
        'id.number'     => '选择数据无效',
        'ids.require'   => '请选择数据',
        'ids.array'     => '请选择数据',
        'title.require' => '标题必填'
    ];

    protected $scene = [
        'detail' => ['id'],
        'create' => ['title'],
        'update' => ['id', 'title'],
        'delete' => ['id']
    ];
}